﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Styx.WoWInternals;
using Styx;

namespace SwInYUtility
{
    internal static class MassInvite
    {
        public static void Invite(List<Player> ToInvite)
        {
            Log.Write(Log.eLogType.GuildInviter, "--------------------------------------------------");
            Log.Write(Log.eLogType.GuildInviter, "Inviting {0} Players", ToInvite.Count());
            Log.Write(Log.eLogType.GuildInviter, "--------------------------------------------------");


            foreach (Player CurPlayer in ToInvite)
            {
                StyxWoW.SleepForLagDuration();
                Log.Write(Log.eLogType.GuildInviter ,"Inviting: {0}  Level: {1}", CurPlayer.Name, CurPlayer.Level);
                Lua.DoString("GuildInvite(\"" + CurPlayer.Name + "\")");
                HasInvited.Add(CurPlayer.Name);
            }

            Log.Write(Log.eLogType.GuildInviter, "--------------------------------------------------");

        }
    }
}
